package org.huawei260.TiKu.ODsuanfa;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class A_2023A_2801__哈希表删除最少字符 {

//	public class RemoveLeastFrequent {
//		public static void main(String[] args) {
//			String s = "abcdd";
//			String result = removeLeastFrequentChars(s);
//			System.out.println(result);
//		}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		System.out.println(removeLeastFrequentChars(input));
	}

		public static String removeLeastFrequentChars(String s) {
			// 统计每个字符出现的次数
			Map<Character, Integer> charCount = new HashMap<>();
			for (char c : s.toCharArray()) {
				charCount.put(c, charCount.getOrDefault(c, 0) + 1);
			}

			// 找到最少出现次数
			int minCount = Integer.MAX_VALUE;
			for (int count : charCount.values()) {
				minCount = Math.min(minCount, count);
			}

			// 删除所有出现次数最少的字符
			StringBuilder sb = new StringBuilder();
			for (char c : s.toCharArray()) {
				if (charCount.get(c) > minCount) {
					sb.append(c);
				}
			}

			// 输出结果
			String result = sb.toString();
			return result.isEmpty() ? "empty" : result;
		}
	}